package com.service.impl;

import com.dao.MenuMapper;
import com.domain.Menu;
import com.service.MenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MenuServiceImpl implements MenuService {

    @Autowired
    private MenuMapper menuMapper;

    /*
     * 查询所有父子菜单信息
     * */
    @Override
    public List<Menu> findAllMenuByPid(int pid) {
        return menuMapper.findAllMenuByPid(pid);
    }
    /*
     * 查询所有菜单
     * */
    @Override
    public List<Menu> findAllMenu() {
        return menuMapper.findAllMenu();
    }
    /*
     * 根据id查找菜单
     * */
    @Override
    public Menu findMenuById(Integer id) {
        return menuMapper.findMenuById(id);
    }
    /*
     * 添加菜单
     * */
    @Override
    public void saveMenu(Menu menu) {
        menuMapper.saveMenu(menu);
    }
    /*
     * 修改菜单
     * */
    @Override
    public void updateMenu(Menu menu) {
        menuMapper.updateMenu(menu);
    }
}
